package cn.easthome.demo;

import cn.easthome.demo.service.IUserService;
import cn.easthome.demo.service.UserServiceImpl;

/**
 * 验证用户登录
 */
import java.util.Scanner;

public class JDBCTest {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入用户名:\n");
        String username=sc.next();
        System.out.println("请输入密码:\n");
        String password=sc.next();
        //和数据库中的user表的用户名和密码进行比较
        IUserService userService=new UserServiceImpl();
        boolean flag=userService.isCheckLogin(username,password);
        if(flag){
            System.out.println("登录成功");
        }else{
            System.out.println("登录失败");
        }
        //匹配登录成功
        //匹配登录失败
    }
}
